package com.example.controller;

import com.example.po.SysServer;
import com.example.service.SysServerService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @className: SysServerController
 * @author: chentao
 * @date: 2025/7/25 8:53
 * @Version: 1.0
 * @description:
 */
@RestController
public class SysServerController {

    @Resource
    private SysServerService sysServerService;

    /***
     * 获取活跃服务节点key列表
     * @return
     */
    @RequestMapping(value = "getActiveServerKeys")
    public List<Long> getActiveServerKeys() {
        return sysServerService.getActiveServerKeys();
    }

    /***
     * 获取所有激活的服务器列表
     * @return
     */
    @RequestMapping(value = "getActiveServerList")
    public List<SysServer> getActiveServerList() {
        return sysServerService.getActiveServerList();
    }
}
